
/** This file is part of REMBRANDT - Named Entity Recognition Software
 *  (http://xldb.di.fc.ul.pt/Rembrandt)
 *  Copyright (c) 2008-2009, Nuno Cardoso, University of Lisboa and Linguateca.
 *
 *  REMBRANDT is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  REMBRANDT is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with REMBRANDT. If not, see <http://www.gnu.org/licenses/>.
 */
package renoir.eval.geoclef.pertopic.year2005

import groovy.util.GroovyTestCase
import rembrandt.gazetteers.CommonClassifications as SC
import renoir.obj.*
import renoir.test.geoclef.pertopic.GeoCLEF_PerTopic_Test
import saskia.bin.Configuration
/**
 * @author Nuno Cardoso
 *
 */
class GeoCLEF_2005_EN_007_Test extends GroovyTestCase {

	Configuration conf
	GeoCLEF_PerTopic_Test pertopic

	public GeoCLEF_2005_EN_007_Test() {
		conf = Configuration.newInstance()
		//	conf.set("saskia.dbpedia.url","http://xldb.di.fc.ul.pt/dbpedia/sparql")
		//	conf.set("saskia.dbpedia.url","http://dbpedia.org/sparql")
		//	println "DBpedia sparql service set to "+conf.get("saskia.dbpedia.url","none")
		pertopic = new GeoCLEF_PerTopic_Test(conf)
	}

	void testTopic() {
		String lang = "en"
		String topic = "label:007 Trade unions in Europe"

		RenoirQuery rq = RenoirQueryParser.parse(topic)
		Question question = pertopic.process(rq, lang)
		//dumpQuestion(question)

		/** check sentences and question types */
		assert question.sentence*.text == [
			'Trade',
			'unions',
			'in',
			'Europe']
		assert question.questionType == QuestionType.None
		assert question.questionTypeTerms.size() == 0


		// check detected NEs
		assert question.nes.size() == 1
		//println "question nes wikipedia stuff & dbpedia stuff: "+question.nes[0].wikipediaPage+ " "+question.nes[0].dbpediaPage
		//	assert question.nes[0].terms*.text == ["Oil"]
		assert question.nes[0].terms*.text == ["Europe"]

		/// contains gives false. Use find
		//	assert question.nes[0].classification.find{it == SC.thing_object}
		assert question.nes[0].classification.find{it == SC.place_human_division}

		// check subjects
		assert question.subject != null
		assert question.subject.subjectTerms*.text == ["Trade", "unions"]
		assert question.subject.geoscopeTerms*.text == ["Europe"]

		assert question.subject.subjects*.sbj_subject == [
			"en:[Trade][Unions];pt:[Sindicatos]"
		]
		assert question.subject.geoscopes*.geo_name.contains("pt:Europa;en:Europe")
		// and, since it was expanded, test a country
		assert question.subject.geoscopes*.geo_name.contains("pt:Portugal;en:Portugal")
		assert question.subject.subjectgrounds*.sgr_dbpedia_resource.contains("Category:Trade_unions_in_Portugal")
		// subjectgrounds like that, fills the categoryWikipediaAsDBPediaResource
		assert question.subject.categoryWikipediaAsDBPediaResource.contains("Category:Trade_unions_in_Portugal")

		// assert conditions
		// "in Europe" was absorbed by the Subject
		// and it solves it pretty well without scopes!
		assert !question.conditions //.size() == 1
		//	assert question.conditions[0].object instanceof QueryGeoscope
		//	assert question.conditions[0].object.ne.terms*.text == ["Europe"]
		//	assert question.conditions[0].object.classification*.c == ["@LOCAL"]

		// now, QuestionEATForEN stuff... it should copy question.subject to question.EATs
		assert question.expectedAnswerTypes[0].DBpediaOntologyResources.contains("Category:Trade_unions_in_Portugal")
		assert question.expectedAnswerTypes[0].resolvesTo == ExpectedAnswerType.Type.DBpediaOntologyResource

		// SELECT DISTINCT ?s WHERE { { {?s skos:subject <http://dbpedia.org/resource/Category:Trade_unions_in_Portugal> }
		// UNION { ?s skos:subject ?category . ?category skos:broader <http://dbpedia.org/resource/Category:Trade_unions_in_Portugal> } }
		//  answers :
		/*http://dbpedia.org/resource/Manuel_Carvalho_da_Silva
		 http://dbpedia.org/resource/Coimbra_Academic_Association
		 http://dbpedia.org/resource/General_Confederation_of_the_Portuguese_Workers
		 http://dbpedia.org/resource/General_Union_of_Workers_%28Portugal%29
		 http://dbpedia.org/resource/Union_of_Independent_Trade_Unions_%28Portugal%29
		 http://dbpedia.org/resource/General_Confederation_of_Labour_%28Portugal%29
		 */
		assert question.answer.contains("http://dbpedia.org/resource/General_Confederation_of_the_Portuguese_Workers")

		ReformulatedQuery refq = QueryReformulator2.reformulate(rq, question)

		println refq.toString()
		String reformulated_x = """
label:007 contents:"Trade unions" contents:"Europe" entity:Cyprus_Union_of_Bank_Employees entity:Democratic_Labour_Federation_of_Cyprus entity:Cyprus_Turkish_Unions_Federation entity:Revolutionary_Trade_Unions_Federation entity:Cyprus_Workers%27_Confederation entity:Pancyprian_Public_Servants%27_Trade_Union entity:Pancyprian_Federation_of_Labour entity:Federation_of_Trade_Unions_of_Ukraine entity:National_Confederation_of_the_Trade-Union_Organizations_of_Ukraine entity:Confederation_of_Free_Trade_Unions_of_Ukraine entity:Direct_action_%28trade_union%29 entity:James_Maxton entity:Arthur_MacManus entity:Hugh_Brown_%28British_politician%29 entity:John_William_Muir entity:Manny_Shinwell%2C_Baron_Shinwell entity:George_Buchanan_%28politician%29 entity:Battle_of_George_Square entity:Clyde_Workers%27_Committee entity:Patrick_Dollan entity:Willie_Gallacher entity:Neil_Maclean_%28politician%29 entity:John_Wheatley entity:David_Kirkwood entity:Mary_Barbour entity:John_Maclean_%28Scottish_socialist%29 entity:Red_Clydeside entity:Edward_Hunter_%28Billy_Banjo%29 entity:Tom_Johnston_%28politician%29 entity:James_Maley entity:British_police_strikes_in_1918_and_1919 entity:Colour_Strike entity:Welsh_coal_strike_of_1898 entity:London_Dock_Strike_of_1889 entity:Black_Friday_%281921%29 entity:Ulster_Workers%27_Council_strike entity:Liverpool_dockers%27_strike entity:Docks_strike_of_1970 entity:Timex_strike entity:1926_United_Kingdom_general_strike entity:UK_firefighter_dispute_2002%E2%80%932003 entity:Upper_Clyde_Shipbuilders entity:Invergordon_Mutiny entity:1911_Liverpool_general_transport_strike entity:2007_Royal_Mail_industrial_disputes entity:Southampton_Dock_Strike_of_1890 entity:Burston_Strike_School entity:Scottish_Nursery_Nurses_Strike entity:Power_dispute_of_1964 entity:2009_Lindsey_Oil_Refinery_strikes entity:Winter_of_Discontent entity:UK_miners%27_strike_%281984%E2%80%931985%29 entity:Battle_of_Orgreave entity:Wapping_dispute entity:1775_Liverpool_Seamen%27s_Revolt entity:Tonypandy_Riot entity:Grunwick_dispute entity:London_matchgirls_strike_of_1888 entity:Organisation_for_the_Maintenance_of_Supplies entity:1842_General_Strike entity:2009_Royal_Mail_industrial_disputes entity:1988_United_Kingdom_postal_workers_strike entity:1971_United_Kingdom_postal_workers_strike entity:2009_Leeds_refuse_workers_strike entity:Taff_Vale_Railway_Co_v_Amalgamated_Society_of_Railway_Servants entity:New_Unionism entity:Transport_House entity:Tolpuddle_Martyrs entity:Triple_Alliance_%281914%29 entity:Ridley_Plan entity:Criminal_Law_Amendment_Act_1871 entity:Durham_Miners%27_Gala entity:Trade_Union_and_Labour_Relations_%28Consolidation%29_Act_1992 entity:Trade_Union_Act_1984 entity:Charles_Norman_Greenfield entity:Conservative_Trade_Unionists entity:Trade_Disputes_Act_1906 entity:Mary_Bamber entity:National_Dock_Labour_Board entity:Associated_Society_of_Locomotive_Engineers_and_Firemen_v_United_Kingdom entity:Pageant_of_Labour entity:Postal_and_Telegraph_Clerks%27_Association entity:Travail.Suisse entity:Swiss_Federation_of_Trade_Unions entity:Trade_unions_in_Switzerland entity:Unia_%28union%29 entity:Swedish_Teachers%27_Union entity:Swedish_Union_of_Local_Government_Officers entity:Swedish_Association_of_Health_Professionals entity:Swedish_Police_Union entity:Swedish_Confederation_of_Professional_Employees entity:Swedish_Union_of_Insurance_Employees entity:Swedish_Union_of_Clerical_and_Technical_Employees_in_Industry entity:TCO_Certification entity:Financial_Sector_Union_of_Sweden entity:Swedish_Union_of_Commercial_Salaried_Employees entity:Swedish_Union_of_Civil_Servants entity:Swedish_Union_of_Journalists entity:Swedish_Municipal_Workers%27_Union entity:Swedish_Graphic_Workers%27_Union entity:Swedish_Industrial_Union entity:Swedish_Musicians%27_Union entity:Swedish_Paper_Workers%27_Union entity:Swedish_Union_for_Service_and_Communications_Employees entity:Swedish_Trade_Union_Confederation entity:Swedish_Transport_Workers%27_Union entity:Swedish_Building_Workers%27_Union entity:Swedish_Commercial_Employees%27_Union entity:Swedish_Electricians%27_Union entity:Swedish_Hotel_and_Restaurant_Workers%27_Union entity:Swedish_Painters%27_Union entity:IF_Metall entity:Swedish_Building_Maintenance_Workers%27_Union entity:Swedish_Food_Workers%27_Union entity:Swedish_Forest_and_Wood_Workers%27_Union entity:Swedish_Metalworkers%27_Union entity:GS_%28Swedish_union%29 entity:Swedish_General_Strike entity:Saltsj%C3%B6baden_Agreement entity:Fredrik_Sterky entity:Wanja_Lundby-Wedin entity:Annika_Billstr%C3%B6m entity:Per_Johansson_%28trade_unionist%29 entity:Charles_Lindley entity:Edvard_Johanson entity:Albert_Forslund entity:Gunnar_Nilsson_%28trade_unionist%29 entity:Karl_Kilbom entity:Set_Persson entity:Gunnar_Andersson_%28trade_unionist%29 entity:Arvid_Thorberg entity:August_Lindberg entity:Axel_Strand entity:Arne_Geijer entity:Anna_Sterky entity:Chalmers_Students%27_Union entity:Pharmaceutical_Students_Association%2C_Uppsala entity:HHUS entity:Student_Association_at_the_Stockholm_School_of_Economics entity:Student_Union_at_the_Royal_Institute_of_Technology entity:Uppsala_Student_Union entity:Datasektionen entity:Central_Organisation_of_the_Workers_of_Sweden entity:Syndikalistiska_Arbetarefederationen entity:National_Socialist_Industrial_Workers%27_Union entity:Swedish_Confederation_of_Professional_Associations entity:Unemployment_funds_in_Sweden entity:Unionen entity:A_las_Barricadas entity:Durruti_Column entity:Solidaridad_Obrera_%28periodical%29 entity:Confederaci%C3%B3n_Nacional_del_Trabajo entity:Joaqu%C3%ADn_Maur%C3%ADn entity:Ram%C3%B3n_Gonz%C3%A1les_Pe%C3%B1a entity:Marcelino_Camacho entity:Workers%27_Commissions entity:Uni%C3%B3n_General_de_Trabajadores entity:Solidaridad_Obrera_%28historical_union%29 entity:Spanish_Trade_Union_Organisation entity:Langile_Abertzaleen_Batzordeak entity:Francisco_de_Vitoria_Association entity:Basque_Workers%27_Solidarity entity:Agrarian_Trade_Union_Federation entity:Col%C2%B7lectius_d%27Obrers_en_Lluita entity:Workers_Collectives entity:Confederaci%C3%B3n_General_del_Trabajo entity:Typographic_Workers_Trade_Union entity:Judges_for_Democracy entity:Professional_Association_of_Magistrates entity:Solidaridad_Obrera_%28union%29 entity:Casa_del_pueblo entity:San_Marino_Confederation_of_Labour entity:Democratic_Confederation_of_San_Marino_Workers entity:Confederation_of_New_Trade_Unions_of_Slovenia entity:Confederation_of_Trade_Unions_of_Slovenia_%E2%80%93_Pergam entity:Association_of_Free_Trade_Unions_of_Slovenia entity:Trade_Union_Confederation_90_of_Slovenia entity:Gheorghe_Cristescu entity:Ghizela_Vass entity:%C5%9Etefan_Gheorghiu_%28trade_unionist%29 entity:David_Korner entity:Vasile_Luca entity:Grigore_R%C4%83ceanu entity:Ion_Niculi entity:Olga_Bancic entity:Virgil_Trofin entity:Gheorghe_Apostol entity:Gheorghe_Flondor entity:I._C._Frimu entity:Iorgu_Iordan entity:Nicolae_Carandino entity:National_Trade_Union_Confederation_%28Romania%29 entity:League_of_Miners_Unions_of_the_Jiu_Valley entity:SLOMR entity:De%C5%9Fteptarea entity:National_Confederation_of_Free_Trade_Unions_of_Romania_%E2%80%93_Brotherhood entity:National_Trade_Union_Bloc entity:Democratic_Trade_Union_Confederation_of_Romania entity:Corpul_Muncitoresc_Legionar entity:National_Trade_Union_Confederation_%E2%80%93_Meridian entity:Manuel_Carvalho_da_Silva entity:Coimbra_Academic_Association entity:General_Confederation_of_the_Portuguese_Workers entity:General_Union_of_Workers_%28Portugal%29 entity:Union_of_Independent_Trade_Unions_%28Portugal%29 entity:General_Confederation_of_Labour_%28Portugal%29 entity:Ryszard_Musielak entity:Antoni_Stawikowski entity:Alfred_Miodowicz entity:Marian_Krzaklewski entity:1981_warning_strike_in_Poland entity:Lublin_1980_strikes entity:June_1976_protests entity:Jastrz%C4%99bie-Zdr%C3%B3j_1980_strikes entity:1988_Polish_strikes entity:1923_Krak%C3%B3w_riot entity:Jerzy_Popie%C5%82uszko entity:Monument_to_the_Fallen_Shipyard_Workers_of_1970 entity:Polish_Solidarity_Campaign entity:Independent_Students_Union entity:Summer_1981_hunger_demonstrations_in_Poland entity:Polish_Round_Table_Agreement entity:Gda%C5%84sk_Agreement entity:Tygodnik_Solidarno%C5%9B%C4%87 entity:Pacification_of_Wujek entity:Solidarity_%28Polish_trade_union%29 entity:Solidarity_Electoral_Action entity:21_demands_of_MKS entity:Solidarity_Citizens%27_Committee entity:Martial_law_in_Poland entity:Free_Trade_Unions_of_the_Coast entity:Inter-Enterprise_Strike_Committee entity:History_of_Solidarity entity:Fighting_Solidarity entity:Radio_Solidarity entity:Solidarity_logo entity:Federation_of_Fighting_Youth entity:Bydgoszcz_events entity:Robotnik_%281983%E2%80%931990%29 entity:Strike_%282006_film%29 entity:National_Coordinating_Commission entity:Rural_Solidarity entity:August_31%2C_1982_demonstrations_in_Poland entity:Solidaryca entity:History_of_Polish_Trade_Unions entity:Workers%27_Initiative entity:Free_Union_of_Poland entity:All-Poland_Alliance_of_Trade_Unions entity:Trade_Unions_Forum entity:United_Federation_of_Trade_Unions entity:Norwegian_Post_and_Communications_Union entity:Union_of_Employees_in_Commerce_and_Offices entity:Norwegian_Union_of_Chemical_Industry_Workers entity:Norwegian_Industrial_Workers_Museum entity:Norwegian_Confederation_of_Trade_Unions entity:A-pressen entity:Norwegian_Civil_Service_Union entity:Norwegian_Seafarers%27_Union entity:Tiden_Norsk_Forlag entity:Norwegian_Union_of_Railway_Workers entity:EL_%26_IT_Forbundet entity:Norwegian_Union_of_Municipal_and_General_Employees entity:Norwegian_Union_of_General_Workers entity:Norwegian_Union_of_Food%2C_Beverage_and_Allied_Workers entity:Norwegian_Union_of_Iron_and_Metalworkers entity:Leaders_of_the_Norwegian_Confederation_of_Trade_Unions entity:Norwegian_Postal_Organization entity:LO_Stat entity:Alf_Martin_Bj%C3%B8rn%C3%B8 entity:Yngve_H%C3%A5gensen entity:Bj%C3%B8rgulv_Froyn entity:Olav_Hindahl entity:Odd_H%C3%B8jdahl entity:Gustav_Sjaastad entity:Eli_Kristiansen entity:Hans_Frette entity:Rolf_Wickstr%C3%B8m entity:Ragnvald_Mikal_Andersen entity:Odd_Chr._G%C3%B8the entity:Stein_Reeg%C3%A5rd entity:Ole_Georg_Gj%C3%B8steen entity:Jacob_Vidnes entity:Gunnar_Br%C3%A5then entity:Lars_Evensen entity:Nils_Olav_Totland entity:Vidar_Bj%C3%B8rnstad entity:Rolf_Nilssen entity:Olav_Bruvik entity:Tor_Halvorsen entity:Leif_Haraldseth entity:Idar_Norstrand entity:Oskar_Skogly entity:Per_Rune_Henriksen entity:Roger_Gudmundseth entity:Gunvald_Engelstad entity:Roar_Fl%C3%A5then entity:Ingvald_Haugen entity:Karl_Henry_Karlsen entity:Kittill_Kristoffersen_Berg entity:Sverre_Oddvar_Andresen entity:Tor_Aspengren entity:Tor-Arne_Str%C3%B8m entity:Sverre_Johan_Juvik entity:Rolf_Furuseth entity:Sigurd_Marcussen entity:Hans_Haga entity:Arve_Toft entity:Atle_Teigland entity:Ludvik_Buland entity:Olaf_Bjerke entity:Gunnar_Ousland entity:Einar_Jansen entity:Arne_Magnussen entity:Alfred_Madsen entity:Gerd-Liv_Valla entity:Egil_Solin_Ranheim entity:Ulf_Guttormsen entity:Terje_Aasland entity:Reidun_Gravdahl entity:Jacqueline_Smith_%28trade_unionist%29 entity:Dagfinn_Habberstad entity:Svein_Fjellheim entity:Hans_O._Felix entity:Trygve_Moe_%28journalist%29 entity:Ole_N._Hoemsnes entity:Emil_L%C3%B8vlien entity:Hans_G._Jensen entity:Christian_Holtermann_Knudsen entity:Anders_Buen entity:Juul_Bjerke entity:Sture_Arntzen entity:Vegard_Sletten entity:Ivar_Johansen_%28journalist%29 entity:John_Marius_Trana entity:Harry_Vestli entity:Nils_Mugaas entity:Erik_Skogstr%C3%B8m entity:Ove_Dalsheim entity:Kleiv_Fiskvik entity:Inger_Lise_Hus%C3%B8y entity:Ole_Lys%C3%B8 entity:Karl_Johan_Aar%C3%B8nes entity:Oscar_Andreas_Ingebrigtsen entity:Magnus_Midtb%C3%B8 entity:Svein_Gunnar_Morgenlien entity:Jon_Hol entity:Anna_Berentine_Anthoni entity:Esther_Kost%C3%B8l entity:Kaare_Sandegren entity:Inge_Myrvoll entity:Arve_Bakke entity:Leif_Thue entity:Ragnar_Kalheim entity:Per_%C3%98stvold entity:Norwegian_Non-Fiction_Writers_and_Translators_Association entity:Norwegian_Medical_Association entity:Norwegian_Society_of_Engineers_and_Technologists entity:Federation_of_Norwegian_Professional_Associations entity:Sivil%C3%B8konomene entity:Det_norske_Arbeiderforbund entity:Confederation_of_Unions_for_Professionals%2C_Norway entity:Norwegian_Agrarian_Association entity:Norwegian_Union_of_Journalists entity:Tekna_%28Norway%29 entity:Norwegian_Airline_Pilots_Association entity:Norwegian_Farmers_and_Smallholders_Union entity:Confederation_of_Malta_Trade_Unions entity:Malta_Workers%27_Union entity:General_Workers%27_Union_%28Malta%29 entity:Union_of_Monaco_Trade_Unions entity:Confederation_of_Trade_Unions_of_the_Republic_of_Moldova entity:Federation_of_Independent_Trade_Unions_of_Moldova entity:Marcel_Glesener entity:Jean_Spautz entity:Aly_Jaerling entity:Gaston_Gib%C3%A9ryen entity:Albert_Bousser entity:Louis_Rech entity:Ali_Kaes entity:Marcel_Schlechter entity:Marc_Spautz entity:Luxembourg_Confederation_of_Christian_Trade_Unions entity:Free_Luxembourger_Workers%27_Union entity:Liechtenstein_Employees%27_Association entity:Confederation_of_Trade_Unions_of_the_Slovak_Republic entity:Independent_Christian_Trade_Unions_of_Slovakia entity:Lithuanian_Trade_Union_Confederation entity:Lithuanian_Trade_Union_%E2%80%93_Solidarity entity:Lithuanian_Labour_Federation entity:Gewerkschaftsbund_des_Memelgebietes entity:Free_Trade_Union_Confederation_of_Latvia entity:Luigi_Antonini entity:Giuliana_Sgrena entity:Carlo_Tresca entity:Savino_Pezzotta entity:Tullio_Cianetti entity:Renata_Polverini entity:Giuseppe_Giulietti_%28trade_unionist%29 entity:Confederazione_Generale_del_Lavoro entity:Confederazione_del_Comitati_di_Base entity:Camera_del_Lavoro entity:Unione_Sindacale_Italiana entity:Italian_Confederation_of_Workers%27_Trade_Unions entity:DIRFOR entity:Italian_General_Confederation_of_Labour entity:Italian_Labour_Union entity:Italian_Confederation_of_Free_Workers%27_Unions entity:General_Labour_Union_%28Italy%29 entity:National_Autonomous_School_Workers%27_Trade_Union entity:Workers_Autonomous_Trade_Unions_Confederation entity:Gu%C3%B0mundur_Gunnarsson entity:Confederation_of_State_and_Municipal_Employees_of_Iceland entity:Icelandic_Federation_of_Labour entity:Forum_for_the_Cooperation_of_Trade_Unions entity:National_Federation_of_Workers%27_Councils entity:National_Confederation_of_Hungarian_Trade_Unions entity:Democratic_Confederation_of_Free_Trade_Unions entity:Autonomous_Trade_Union_Confederation entity:Association_of_Croatian_Public_Sector_Unions entity:Union_of_Autonomous_Trade_Unions_of_Croatia entity:Workers%27_Trade_Union_Association_of_Croatia entity:Independent_Trade_Unions_of_Croatia entity:Croatian_Trade_Union_Association entity:All-Workers_Militant_Front entity:General_Confederation_of_Greek_Workers entity:Civil_Servants%27_Confederation entity:Periodical_and_Electronic_Press_Union entity:Panhellenic_Federation_of_Journalists%27_Unions entity:Journalists%27_Union_of_the_Athens_Daily_Newspapers entity:Confederation_of_German_Trade_Unions entity:IG_Bergbau%2C_Chemie%2C_Energie entity:Food%2C_Beverages_and_Catering_Union entity:TRANSNET_Gewerkschaft entity:IG_Metall entity:Vereinte_Dienstleistungsgewerkschaft entity:IG_Bauen-Agrar-Umwelt entity:Education_and_Science_Workers%E2%80%99_Union entity:Trade_Union_of_the_Police entity:Dieter_Schulte entity:Adexa entity:Harry_Tisch entity:Michael_Sommer entity:Emma_Ihrer entity:Fritz_Tarnow entity:Christian_H%C3%A4rle entity:Hans_B%C3%B6ckler entity:Ursula_Engelen-Kefer entity:Manfred_Schell entity:Free_German_Trade_Union_Federation entity:German_Salaried_Employees%27_Union entity:Free_Association_of_German_Trade_Unions entity:Komba_gewerkschaft entity:Free_Workers%27_Union_of_Germany entity:German_Labour_Front entity:Trade_unions_in_Germany entity:Christian_Trade_Union_Federation_of_Germany entity:German_Civil_Service_Federation entity:Kabineklar entity:Free_Workers%27_Union entity:Gewerkschaft_Deutscher_Lokomotivf%C3%BChrer entity:Reichsbund_der_Deutschen_Beamten entity:General_Confederation_of_Labour_%28France%29 entity:L%C3%A9on_Jouhaux entity:Fernand_Pelloutier entity:Pierre_Juquin entity:Olivier_Besancenot entity:Henri_Krasucki entity:Pierre_Semard entity:Jacques_Bino entity:Marceau_Pivert entity:Jean_Suret-Canale entity:Paul_Rassinier entity:Robert_Louzon entity:Pierre_Bi%C3%A9try entity:Union_Nationale_des_%C3%89tudiants_de_France entity:Union_Nationale_Inter-universitaire entity:Black_African_Students_Federation_in_France entity:Union_nouvelle_et_ind%C3%A9pendante-syndicat_universitaire entity:French_Confederation_of_Management_%E2%80%93_General_Confederation_of_Executives entity:Solidaires_Unitaires_D%C3%A9mocratiques entity:Action_Police_CFTC entity:Syndicat_de_la_Magistrature entity:Conf%C3%A9d%C3%A9ration_g%C3%A9n%C3%A9rale_du_travail_unitaire entity:F%C3%A9d%C3%A9ration_fran%C3%A7aise_de_la_couture entity:Syndicat_de_l%27Architecture entity:Conf%C3%A9d%C3%A9ration_g%C3%A9n%C3%A9rale_du_travail_de_Guadeloupe entity:Main-d%27%C5%93uvre_immigr%C3%A9e entity:National_Union_of_Autonomous_Unions entity:French_Democratic_Confederation_of_Labour entity:Conf%C3%A9d%C3%A9ration_G%C3%A9n%C3%A9rale_du_Travail-Syndicaliste_R%C3%A9volutionnaire entity:Federation_for_National_Education entity:Workers%27_Force entity:Charter_of_Amiens entity:French_Confederation_of_Christian_Workers entity:Conf%C3%A9d%C3%A9ration_nationale_du_travail entity:Bourse_du_Travail entity:Sud-PTT entity:Revolutionary_Syndicalist_Committees entity:Union_syndicale_des_magistrats entity:Union_Nationale_Lyc%C3%A9enne entity:Union_syndicale_des_journalistes_CFDT entity:Union_of_Health_and_Social_Care_Services entity:Confederation_of_State_Employees%27_Unions_%E2%80%93_Pardia entity:Finnish_Confederation_of_Salaried_Employees entity:Finnish_Union_of_Practical_Nurses entity:Union_of_Salaried_Employees entity:Confederation_of_Unions_for_Academic_Professionals_in_Finland entity:SAFA_%28architecture%29 entity:Association_of_Employees_in_Government_Educational_Administration entity:Finnish_Association_of_Graduate_Engineers entity:National_Union_of_University_Students_in_Finland entity:Student_unionism_in_Finland entity:Salli entity:Central_Organisation_of_Finnish_Trade_Unions entity:Comprehensive_Income_Policy_Agreement entity:Bohemian-Moravian_Confederation_of_Trade_Unions entity:Christian_Labour_Confederation entity:Estonian_Employees%27_Unions%27_Confederation entity:Confederation_of_Estonian_Trade_Unions entity:Danish_Association_of_Pharmaconomists entity:Danish_Union_of_Teachers entity:The_Danish_Nurses%27_Organization entity:FTF_%E2%80%93_Confederation_of_Professionals_in_Denmark entity:Danish_Timber_Industry_and_Construction_Workers%27_Union entity:Danish_Union_of_Public_Employees entity:Fagligt_F%C3%A6lles_Forbund entity:LO%2C_The_Danish_Confederation_of_Trade_Unions entity:Danish_Union_of_Professional_Technicians entity:Danish_Food_and_Allied_Workers%27_Union entity:Danish_Union_of_Metalworkers entity:National_Union_of_Commercial_and_Clerical_Employees entity:Jens_Jensen_%28trade_unionist%29 entity:Danish_Medical_Association entity:Danish_Association_of_Chartered_Surveyors entity:Danish_Union_of_Architects entity:Danish_Union_of_Librarians entity:AC_%E2%80%93_The_Danish_Confederation_of_Professional_Associations entity:Confederation_of_Independent_Trade_Unions_of_Bulgaria entity:Confederation_of_Labour_Podkrepa entity:National_Trade_Union_Promyana entity:Free_Trade_Unions_%28Bulgaria%29 entity:Frantz_Vitko entity:Leonid_Kozik entity:Federation_of_Trade_Unions_of_Belarus entity:Belarus_Free_Trade_Union entity:Belarusian_Congress_of_Democratic_Trade_Unions entity:Confederation_of_Independent_Trade_Unions_of_Bosnia_and_Herzegovina entity:Confederation_of_Trade_Unions_of_the_Republika_Srpska entity:General_Federation_of_Belgian_Labour entity:General_Confederation_of_Liberal_Trade_Unions_of_Belgium entity:Confederation_of_Christian_Trade_Unions entity:Austrian_Chamber_of_Labour entity:Austrian_Trade_Union_Federation entity:Andorran_Workers%27_Union entity:Trade_unions_in_Andorra entity:Trade_unions_in_Albania entity:United_Trade_Unions_of_Albania entity:United_Independent_Albanian_Trade_Unions entity:Confederation_of_Trade_Unions_%28Albania%29 woeid:24865675 woeid:12577865 woeid:20069817 woeid:20069818 woeid:23424742 woeid:23424744 woeid:23424750 woeid:23424757 woeid:23424761 woeid:23424765 woeid:23424771 woeid:23424796 woeid:23424803 woeid:23424805 woeid:23424810 woeid:23424812 woeid:23424816 woeid:23424819 woeid:23424825 woeid:23424829 woeid:23424833 woeid:23424843 woeid:23424844 woeid:23424845 woeid:23424853 woeid:23424874 woeid:23424875 woeid:23424877 woeid:23424879 woeid:23424881 woeid:23424885 woeid:23424890 woeid:23424892 woeid:23424897 woeid:23424909 woeid:23424910 woeid:23424923 woeid:23424925 woeid:23424933 woeid:23424945 woeid:23424947 woeid:23424950 woeid:23424954 woeid:23424957 woeid:23424975 woeid:23424976 woeid:23424986 woeid:26812346 woeid:28289413
"""

		assert reformulated_x.replaceAll(/(?m)[\s\n]/,"") == refq.toString().replaceAll(/(?m)[\s\n]/,"")
	}
}
